package com.xf.system.utils.websocket;

import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

/**
 * @author xiefengf
 */
@RestController
@RequestMapping("/websocket")
public class TestController {

    @Resource
    private WebSocketServer webSocketServer;

    @GetMapping("/test")
    public String test(){
        try {
            webSocketServer.sendMessage("111");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "测试成功";
    }

}
